|
Dave Kreskowiak wrote: Uhhh...make sure the path you built is legal??
Well, I've tested it in root of D drive , but the exception has occurred again !
The database file (*.mdf) is beside of application's exe file in SQL folder.
With following code , I'm trying to create a new database.
public static string DBFolder = Application.StartupPath + "\\SQL\\";
private void MainForm_Load(object sender, EventArgs e)
{
if (!Directory.Exists(StaticVariables.DBFolder))
Directory.CreateDirectory(StaticVariables.DBFolder);
using (RezaRestaurant.SQL.DataClasses1DataContext dbc = new RezaRestaurant.SQL.DataClasses1DataContext())
if (!dbc.DatabaseExists())
dbc.CreateDatabase();
}
|
|
|
|
|
Youre code sure could use some work. I hate methods that don't take parameters when the name suggests they should.
The problem isn't in the first five lines you posted, up until the second if statement. So now you move on to the next lines. What does the code for dbc.DatabaseExists() and dbc.CreateDatabase() look like?
|
|
|
|
|
Hi,
I publish a setup with click one Installation,
and when i'm trying to install it i get:
application validation did not succeed.
What i'm doing wrong????
|
|
|
|
|
How are we supposed to answer? You have provided no details of what you have done or how you've done it.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: How are we supposed to answer? You have provided no details of what you have done or how you've done it.
I worket wxactly like this[]
Do you need more details?
|
|
|
|
|
i want to use a landscape setup in my c# crystal report app.
|
|
|
|
|
Ok, I can tell you are new here.
Please check out the link at the top entitled 'how to get an answer to your question'.
People here will not do work for you based off your vague requirements, and even if you do state requirements properly chances are you still won't receive free work.
Please post specific problems that are part of your project, we won't start or finish it for you but we will help you along the way.
Please buy a book on the topic you wish to learn and begin studying/learning it. You cannot become a developer overnight.
|
|
|
|
|
And I just want to have a million dollars.
|
|
|
|
|
i have multiple reports in my c# app. i want to view them all using a single report viewer (crystal reports)
|
|
|
|
|
Ok, I can tell you are new here.
Please check out the link at the top entitled 'how to get an answer to your question'.
People here will not do work for you based off your vague requirements, and even if you do state requirements properly chances are you still won't receive free work.
Please post specific problems that are part of your project, we won't start or finish it for you but we will help you along the way.
Please buy a book on the topic you wish to learn and begin studying/learning it. You cannot become a developer overnight.
|
|
|
|
|
Hi all,
Please can someone tell me how to start mobile apps.
i want to write a program to make calls using my pc, where do i start from.
i am new in this area.
|
|
|
|
|
First you need to understand and clarify what you want.
Enobong Adahada wrote: how to start mobile apps.
Enobong Adahada wrote: make calls using my pc
These are two separate environments
only two letters away from being an asset
|
|
|
|
|
Which mobiles? Mobile phones have an OS and not all will support your .net code. If you are aiming at Windows based mobiles, look in to .Net compact framework. There is a plenty of documentation about that on MSDN. If you are aiming at Symbian based mobiles, you can make .net application again and deploy them using RedFiveLabs.
Try out some basic stuff to begin with through the tutorials available.
As far as making calls from PC is concerned, I don't see much relation of that with Mobile development.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Ok, I can tell you are new here.
Please check out the link at the top entitled 'how to get an answer to your question'.
People here will not do work for you based off your vague requirements, and even if you do state requirements properly chances are you still won't receive free work.
Please post specific problems that are part of your project, we won't start or finish it for you but we will help you along the way.
Please buy a book on the topic you wish to learn and begin studying/learning it. You cannot become a developer overnight.
|
|
|
|
|
Hi
the eaziest option i know is sending at commands through the serialport to ur phone,firstly check if ur phone is at compatible then find the at command set for the phone and u can begin from there.
i can do all things......
|
|
|
|
|
Hello,
I've wrote UserControl where one of properties is collection. Item of collection is object of type GroupClass. Code below:
[Serializable]
public class GroupClass
{
private string pGrpupName;
private Control pGroupControl;
[Category("Group")]
[Description("Definition")]
public string GroupName
{
get { return pGrpupName; }
set { pGrpupName = value; }
}
[Category("Group")]
[Description("Definition")]
[Browsable(false)]
public Control GroupControl
{
get { return pGroupControl; }
set { pGroupControl = value; }
}
}
And after when I add item to collection also groupbox should show on UC. I've override some methods in my Collection. It works. But it doesn't when I try to remove item in designer. Groupbox is still there and method RemoveItem doesn't works
public class WRListClass<T> : Collection<T>
{
public event EventHandler<ItemInsertedArgs<T>> BeforeItemInserted;
public event EventHandler<ItemRemovedArgs<T>> BeforeItemRemoved;
public event EventHandler<ItemSetArgs<T>> BeforeItemSet;
public event EventHandler<ItemInsertedArgs<T>> AfterItemInserted;
public event EventHandler<ItemRemovedArgs<T>> AfterItemRemoved;
public event EventHandler<ItemSetArgs<T>> AfterItemSet;
public event EventHandler ListChanged;
protected override void InsertItem(int index, T item)
{
EventHandler<ItemInsertedArgs<T>> beforehandler = BeforeItemInserted;
EventHandler<ItemInsertedArgs<T>> afterhandler = AfterItemInserted;
EventHandler handlerListChanged = ListChanged;
if (beforehandler != null)
{
beforehandler(this, new ItemInsertedArgs<T>(index, item));
}
base.InsertItem(index, item);
if (afterhandler != null)
{
afterhandler(this, new ItemInsertedArgs<T>(index, item));
}
if (handlerListChanged != null)
{
handlerListChanged(this, null);
}
}
public new bool Remove(T item)
{
return base.Remove(item);
}
public new void RemoveAt(int index)
{
base.RemoveAt(index);
}
protected override void RemoveItem(int index)
{
EventHandler<ItemRemovedArgs<T>> beforehandler = BeforeItemRemoved;
EventHandler<ItemRemovedArgs<T>> afterhandler = AfterItemRemoved;
EventHandler handlerListChanged = ListChanged;
T item = default(T);
if (index >= 0)
item = this[index];
WRListClass<T> old = this;
if (beforehandler != null)
{
beforehandler(this, new ItemRemovedArgs<T>(index, item));
}
base.RemoveItem(index);
if (afterhandler != null)
{
afterhandler(this, new ItemRemovedArgs<T>(index, item));
}
if (handlerListChanged != null)
{
if (old != this)
handlerListChanged(this, null);
}
}
protected override void SetItem(int index, T item)
{
EventHandler<ItemSetArgs<T>> beforehandler = BeforeItemSet;
EventHandler<ItemSetArgs<T>> afterhandler = AfterItemSet;
EventHandler handlerListChanged = ListChanged;
WRListClass<T> old = this;
if (beforehandler != null)
{
beforehandler(this, new ItemSetArgs<T>(index, item));
}
base.SetItem(index, item);
if (afterhandler != null)
{
afterhandler(this, new ItemSetArgs<T>(index, item));
}
if (handlerListChanged != null)
{
if (old != this)
handlerListChanged(this, null);
}
}
}
public class ItemInsertedArgs<T> : EventArgs
{
public int Index;
public T Item;
public ItemInsertedArgs(int index, T item)
{
this.Index = index;
this.Item = item;
}
}
public class ItemSetArgs<T> : EventArgs
{
public int Index;
public T Item;
public ItemSetArgs(int index, T item)
{
this.Index = index;
this.Item = item;
}
}
public class ItemRemovedArgs<T> : EventArgs
{
public int Index;
public T Item;
public ItemRemovedArgs(int index, T item)
{
this.Index = index;
this.Item = item;
}
}
----USERCONTROL
[Designer("System.Windows.Forms.Design.ParentControlDesigner", "IDesigner")]
public partial class UserControl1 : UserControl
{
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)]
private WRListClass<GroupClass> pGroups = new WRListClass<GroupClass>();
public UserControl1()
{
InitializeComponent();
pGroups.AfterItemInserted += new EventHandler<ItemInsertedArgs<GroupClass>>(pGroups_AfterItemInserted);
pGroups.BeforeItemRemoved += new EventHandler<ItemRemovedArgs<GroupClass>>(pGroups_BeforeItemRemoved);
}
void pGroups_BeforeItemRemoved(object sender, ItemRemovedArgs<GroupClass> e)
{
if (e != null)
{
if (e.Item != null)
{
if (e.Item.GroupName != null)
{
if (e.Item.GroupName.Trim() != "")
{
if (e.Item.GroupControl != null)
{
e.Item.GroupControl.Parent = null;
this.Controls.Remove(e.Item.GroupControl);
e.Item.GroupControl.Dispose();
}
}
}
}
}
}
void pGroups_AfterItemInserted(object sender, ItemInsertedArgs<GroupClass> e)
{
if (e != null)
{
if (e.Item != null)
{
if (e.Item.GroupName != null)
{
if (e.Item.GroupName.Trim() != "")
{
if (e.Item.GroupControl == null)
{
e.Item.GroupControl = new GroupBox();
e.Item.GroupControl.TabIndex = pGroups.Count + 1;
e.Item.GroupControl.Text = e.Item.GroupName;
e.Item.GroupControl.Name = e.Item.ToString();
e.Item.GroupControl.Parent = this;
this.Controls.Add(e.Item.GroupControl);
e.Item.GroupControl.Dock = DockStyle.Top;
e.Item.GroupControl.BringToFront();
}
}
}
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)]
[EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public WRListClass<GroupClass> Groups
{
get { return pGroups; }
set {
pGroups = value;
}
}
}
Please help! Thanks!
|
|
|
|
|
I'm not going to bother reading that badly formatted code dump because:
1) because it is badly formatted
2) there is too much of it even if it were correctly formatted.
Solution:
1) cut out anything that is not relevant to the problem.
2) surround the remaining code with 'pre' tags and format it properly
You do not ask a question. What is it that you want to know?
Read this[^], before editing your original post. Pay particular attention to items 2, 4, 5 and 7.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi pls i need information on any biometric sdk/dll like the GrFinger that i can use to access the biometric features of an hp ipaq pda,or any pda and the compatible dll/sdk .all shld be .net compatible
i can do all things........
|
|
|
|
|
solomonope wrote: i can do all things........
except search Google ...
|
|
|
|
|
I've made a small app that downloads an XML file every one minute from a server. I have to use a Socket for it as I must write the HTTP headers myself.
The program works fine until it doesn't. Every few minutes the XML that's being downloaded is somewhat corrupt. When I open it I can see the XML with all the normal data, except that in random places there are always 4 random characters that are being inserted. When I use a packet sniffer I can see that the data being received is fine and that the chars aren't in the end or beginning of a packet - just in random places.
This is the loop I'm using to read the XML file:
file = File.Create("C:\\info.xml");
bool isFirstPacket = true;
byte[] buffer = new byte[1024];
int bytesRead;
while (true)
{
bytesRead = stream.Read(buffer, 0, 1024);
if (bytesRead == 0)
continue;
if (isFirstPacket)
{
isFirstPacket = false;
int i = 0;
while (buffer[i] != 0x3c)
{
i++;
}
file.Write(buffer, i, bytesRead - i);
}
else if (buffer[bytesRead - 2] == 0x0d && buffer[bytesRead - 1] == 0x0a && buffer[bytesRead - 3] == 0x0a && buffer[bytesRead - 4] == 0x0d && buffer[bytesRead - 5] == 0x30)
{
file.Write(buffer, 0, bytesRead - 7);
file.Close();
break;
}
else
{
file.Write(buffer, 0, bytesRead);
}
}
file.Close();
Does anyone have a clue as to why this would happen? thanks.
|
|
|
|
|
I can't see anything that jumps out at me, apart from the possibility that you could be addressing a non-vaid location in the else if clause. If bytesRead is less than 5 at this point you could have a problem. Also in this clause you have file.Write(buffer, 0, bytesRead - 7); - should that be 7 or 5?
My only suggestion would be to run it through the debugger and try to see what's going on.
|
|
|
|
|
Thanks for the reply.
The else if works as it should, though you're right I should see if bytesRead is bigger than 5, the reason for the "-7" is some added spaces at the end of the XML.
As I go though the trace and look at the buffers I see these chars inserted in them, I get them through the NetworkStream.Read and still the network sniffer shows a "clear" packet. Odd.
|
|
|
|
|
Hello all of you,
I made a webservice and I can't get this to run via proxy.
the basic procedure on the client side looks like this:
MyWebservice service = new MyWebservice();
WebProxy iProxy = new WebProxy(_proxyAdress, true);
service.Proxy = iProxy;
...
if(service.LogOn(user, pass))
{
...
data = service.GetMyData();
now what happens is that the session variables are lost on the GetMyData() call
on the server side:
[WebMethod (EnableSession = true)]
public bool Logon(string s, string p)
{
...
Context.Session.Add ("LoggedIn", true);
...
return
}
[WebMethod (EnableSession = true)]
public SomeData GetMyData()
{
...
if(Context.Session ["LoggedIn"])
...
}
Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx.
|
|
|
|
|
Have you tried regenerating the proxy?
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
Yes I did, thx for the tip
|
|
|
|