|
bisharbn wrote: Please see ths
What?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Dear All
I'm .Net developer. In my project, When I compile a DLL in Vista PC and run it from the same PC It didn't response. When I disable DEP it responded but took too much time. But the same DLL which is complied in Xp machine response very quickly in Vista PC.( Complied in Xp and run in Vista)
What might be the reason for this greater performance issue?
Thank you,
RSumanan
|
|
|
|
|
Please do not repost. You have already posted question here[^]
Post your question only once.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Experts,
I have created one windows application and deployed it in some 500 machines in my company. The problem is, the applicaiton is updated weekely atlest. I cannot reinstall the .exe once again in all the 500 machines. Any solution for this.........
|
|
|
|
|
Please do not repost the question in different forum.
You question here[^] is already get attention and answered.
If you have not gone through the guidelines for posting question then
please go through with it here[^].
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Please don't do this.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello,
I would like to ask why do I cannot display my records in my datagriview,
the database I use is sql server 2005 with ".mdf" extension. Also
if I use the wizard to add datasource I can add,delete records but when I run change
the startup form to show the records via code connection the records I think is gone or something
in my code is really wrong
The code I use is here:
Imports System.Data.SqlClient
Public Class Form2
Dim con As New SqlConnection
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
con.ConnectionString = "Data Source=.\SQLEXPRESS;" + _
"AttachDbFilename=|DataDirectory|\Database1.mdf;" + _
"Integrated Security=True;User Instance=True"
con.Open()
con.Close()
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
con.Open()
da = New SqlDataAdapter("SELECT * FROM phoneBookTable", con)
da.Fill(dt)
con.Close()
DataGridView1.DataSource = dt.DefaultView
Catch ex As Exception
MsgBox(ex.ToString)
con.Close()
End Try
End Sub
End Class
Thanks,
Dan
|
|
|
|
|
Try using following code instead of yours.
void FillData()
{
using (SqlConnection c = new SqlConnection(DataConnectionString))
{
c.Open();
using (SqlDataAdapter a = new SqlDataAdapter("SELECT * FROM phoneBookTable", c))
{
DataTable t = new DataTable();
a.Fill(t);
}
}
}
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hello,
Thanks for the help, but sorry to say I'm a bit confused about the code you have sent
The code seems not working ing vb 2008 or maybe I am wrong
Thanks over all in trying to help me.
Thanks,
Dan
|
|
|
|
|
The code I have posted is in CSharp.
Just use the idea, you do not need to follow
the exact code. Just follow the steps in VB, in
your way.
So, that you will get if you are missing something.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hello,
Thank, I try to study it
I have some additional question's if you dont mind.
I notice that when I edit the database record and add data on it,
it can show the data that I have add via editing but when
I add data into the database using the wizard or form the records
seems to be dissapear everytime I change the startup form.
(info: form1 - the form that I use to connect via wizard
form2 - form I use via coding connection )
I'm so confused, I can add data but when everytime I change startup form
the records I have added seems gone ,
also everytime I add new records it just overwrite and it doesn't add new row
Below here is my code again :
Imports System.Data.SqlClient
Public Class Form2
Dim con As New SqlConnection
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
con.ConnectionString = "Data Source=.\SQLEXPRESS;" + _
"AttachDbFilename=|DataDirectory|\Database1.mdf;" + _
"Integrated Security=True;User Instance=True"
con.Open()
con.Close()
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
con.Open()
da = New SqlDataAdapter("SELECT * FROM phoneBookTable", con)
da.Fill(dt)
con.Close()
Dim newRows As DataRow = dt.NewRow
With newRows
.Item(0) = "2"
End With
dt.Rows.Add(newRows)
con.Open()
Dim cb As New SqlCommandBuilder(da)
da.Update(dt)
con.Close()
Dim newRows2 As DataRow = dt.NewRow
With newRows2
.Item(0) = "3"
End With
dt.Rows.Add(newRows2)
con.Open()
cb = New SqlCommandBuilder(da)
da.Update(dt)
con.Close()
DataGridView1.DataSource = dt.DefaultView
Catch ex As Exception
MsgBox(ex.ToString)
con.Close()
End Try
End Sub
End Class
thanks again,
Dan
|
|
|
|
|
|
Hello,
Thanks for the nice link. This is really helpfull.
Thanks,
Dan
|
|
|
|
|
My Pleasure.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hello,
A 5 would be good to all of you helping newbie programmers
Thanks,
Dan
|
|
|
|
|
Thank you very much for appreciating.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi,
I have 2 domain names such as www.abc.com and www.xyz.com. I have a machine which is having a manual ip address of 192.168.1.100 and in this machine I have created two websites in the IIS 7.5 in Windows 7, In the binding properties, I have set the ip address assigned/unassigned and the host name to the domain name www.abc.com to one web site and www.xyz.com to the other website, also both the websites run on port 80.
I have a dynalink router, where I have set the Virtual Server => Port Forwarding => Web Server pointing to 192.168.1.100 machine.
I am not able to view the web sites when I give by domain names, when i type www.abc.com I wish to see website1 and www.xyz.com I wish to see website2, When i tried removing the host names from the binding, I am able to view my website1 after typing the domain name www.xyz.com.
Is there anything I am missing or pointing wrongly ? or doing wrong here ? Please advise.
Thanks Vinay
|
|
|
|
|
You don't say what happens when you try to access by domain name. Do you go to the wrong site? Does it say server not available?
Where do you have the DNS entries defined? Do you have nameservers established?
To test your IIS configuration you can go to a machine on your local 192.168 network and add entries to the hosts file for your domains pointing to the 192.168.1.100 address.
|
|
|
|
|
The domain names which I have is pointing to my static IP address 65.149.23.34.
Then in my router I have pointed to the web server of machine 192.168.1.100
In the IIS of the machine 192.168.1.100, I have created two websites and set the host names for both the websites to my domain name.
When I enter the domain names it says page cannot be accessed.
But when I remove the host names from the websites of IIS and access by one domain name, I can access my web page.
Does WINDOWS 7 IIS support only 1 website hosting is it , Do I need to try in windows server 2003 ?
|
|
|
|
|
The only thing I can find with a feature breakdown by OS is here[^] but it doesn't mention host headers. If you are using win 7 professional it doesn't look like a lot of differences. If you are on a lesser version that may be the problem.
|
|
|
|
|
I tried using windows server 2003 and iis 6.0, it worked, I created virtual websites under my website,giving different domain names under the host headers and it worked.
Thanks
Vinay
|
|
|
|
|
Hello coders,
I am getting one problem in the saving the items information. I have taken one textbox for the NumberOfAssets based on which further generates the respective textboxes. And Before saving the information, I want to implement the validation check on those dynamically generated textboxes i.e. those textboxes must not be empty.
For instance, If I enter 3 (integer value) in the "NumberOfAssets" textbox, it further generates the 3 textboxes, And before saving the window form, there must be a validation check for those 3 textboxes.
I could not come up with the solution that how to put the validation using For Loop and where to do it
as well..
please help ...
|
|
|
|
|
Hi,
You'd need to hook up the Validating [^] event.
Below is an example on validating a control from that event;
void onValidating(object sender, CancelEventArgs e)
{
TextBox senderBox = sender as TextBox;
if (senderBox.Text.Length == 0)
{
e.Cancel = true;
System.Media.SystemSounds.Beep.Play();
}
}
..and this is the code to hook up the event. You'd need something similar to this in your For -loop.
myTextBox.Validating += new CancelEventHandler(onValidating);
Good luck
I are Troll
|
|
|
|
|
SCENARIO 1 :
I have 3 projects in my solution:
1) Web Project (Presentation Layer)
2) Class Library Project (Business Logic)
3) Class Library Project (Data Access Layer)
Following are the dependencies among these 3 projects:
1->2->3 (It means I have referenced PL in BL and BL in DAL.
In 3(Data Access Layer) i have written a SQL trigger and in the same trigger i am also calling a function of 2(Business Logic) as i have referenced it already. The code looks like following:
[Microsoft.SqlServer.Server.SqlTrigger(Name = "Trigger1", Target = "test", Event = "FOR INSERT")]
public static void Trigger1()
{
SqlTriggerContext triggContext = SqlContext.TriggerContext;
getData obj = new getData(); //getData is a class in (Business Logic)
DataSet insertTriggerDataSet = new DataSet();
if (triggContext.TriggerAction == TriggerAction.Insert)
{
using (SqlConnection conn = new SqlConnection("context connection=true"))
{
conn.Open();
SqlCommand sqlComm = new SqlCommand();
SqlPipe sqlP = SqlContext.Pipe;
sqlComm.Connection = conn;
sqlComm.CommandText = "select * from test";
//sqlP.Send(sqlComm.CommandText);
//sqlP.ExecuteAndSend(sqlComm);
SqlDataAdapter adapter = new SqlDataAdapter(sqlComm.CommandText, conn);
adapter.SelectCommand.CommandType = CommandType.Text;
called= "trigger.cs";
adapter.Fill(insertTriggerDataSet);
}
}
obj.fetch(insertTriggerDataSet); // fetch is a method in class getData in Business Logic
}
Now the problem is, that is i am registering my assembly of (Data Access Layer) in SQL Server 2005 then due to its all dependencies i am unable to do so (as Data Access Layer is dependent on Business Layer and Business Layer on Presentation Layer, and Presentation Layer is internally dependent on many .NET assemblies)
SCENARIO 2
If i convert my data access layer to SQL Server project then it is impossible to give reference of any other project in my Data Layer as SQL Server Project doesn't accepts references other than SQL Server projects.
My need is to call a method X() of Business Layer in that Trigger (in Data Access Layer) and then in that method X() I have to call a method Y() of my presentation Layer.
Can anyone please suggest me any solution or alternative for this problem?...
Also let me make it clear that I am trying to build an auto update data representation control (like grid view) so whenever a new record is inserted in a SQL table that trigger should work and then it should update the data in used data representation control in presentation layer without any button click or similar event, thats why i am calling all functions internally to create an event while that trigger executes. (Reference Example: Facebook Wall, Twitter stream)
Any help will be appreciated...
Thank you.
|
|
|
|
|
I am using the following code for compression of data at the server:
The job of this method is to execute the specified method passed as a string and return the object as a compressed stream (serializing the object and compressing the serialized stream) to the client application. When value is returned to the client, the decompression takes place there and the decompressed stream is deserialized to obtain the actual object
The method below takes parameters as name of method to be executed including the methodarguments and argumenttypes to distinguish the different overloaded methods and identify the exact method and avoid ambiguity. ExecObject is the object with which the specified method will be invoked.
//SERVER SIDE METHOD
public Stream CompressedMethodCall(string MethodName, object[] MethodArguments, Type[] ArgumentTypes, object ExecObject)
{
object Result;//the object which will be returned by the specified methodname
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter Serializer; //to serialize the object
System.IO.Compression.GZipStream Compressor;//to compress the serialized object
Stream SerializedStream;//contains the stream which is serialized
Stream CompressedStream;//contains the compressed serailized stream
byte[] Buffer;
try
{
MethodInfo mi = ExecObject.GetType().GetMethod(MethodName, ArgumentTypes);
Result = mi.Invoke(ExecObject, MethodArguments);//now result has the object which should be serialized and compressed
if (Result != null)
{
Serializer = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();//binaryformatter is used for compact serialization
SerializedStream = new MemoryStream();
Serializer.Serialize(SerializedStream, Result);//now SeralizedStream has the serialized object
SerializedStream.Position = 0;
Result = null;
CompressedStream = new MemoryStream();
Compressor = new System.IO.Compression.GZipStream(CompressedStream, System.IO.Compression.CompressionMode.Compresstrue);
while (SerializedStream.Position != SerializedStream.Length)
{
long BytesRemaining = SerializedStream.Length - SerializedStream.Position + 1;
if (BytesRemaining < BufferLength)
Buffer = new byte[BytesRemaining];
else
Buffer = new byte[BufferLength];
SerializedStream.Read(Buffer, 0, Buffer.Length);
Compressor.Write(Buffer, 0, Buffer.Length);
}
SerializedStream.Close();
CompressedStream.Position = 0;
return CompressedStream;
}
}
catch (Exception ex)
{
return null;
}
return null;
}
Now the returned value(compressed stream) is used to obtain the actual object. I am doing it this way
//CLIENT SIDE STATIC METHOD
public class DeCompressor
{
const int BufferLength = 4096;
public static object GetObject(Stream CompressedStream)
{
object Result;
BinaryFormatter DeSerializer = new BinaryFormatter();
Stream SerializedStream = new MemoryStream();
CompressedStream.Position = 0;
GZipStream DeCompressor = new GZipStream(CompressedStream, CompressionMode.Decompress,true);
byte[] Buffer;
int Read = 1;
try
{
while (Read > 0)
{
Buffer = new byte[BufferLength];
Read = DeCompressor.Read(Buffer, 0, BufferLength);
if (Read == 0) Read = DeCompressor.Read(Buffer, 0, BufferLength);//sometimes it decompressing 0 bytes eventhough there is data to be decmopressed. If I again call Read() it will decompress. To avoid this, I am using it twice
SerializedStream.Write(Buffer, 0, Read);
}
CompressedStream.Close();
SerializedStream.Position = 0;
Result = DeSerializer.Deserialize(SerializedStream);
SerializedStream.Close();
return Result;
}
catch (Exception ex)
{
Castor.CastorMessageBox.Show(ex.Message);
return null;
}
}
This method is working fine. But sometimes decompression is not producing the exact stream which was produced at server. Due to this, deserialization process is not successful and I am unable to retreive the actual object.
I am using VS2008. Any help would be appreciated
|
|
|
|